import request from "@/api/request";
import { apiClusterJava } from "@/api/root";

// 常用语列表
export const commonTermsList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/getCommonLanguageList",
    data
  );
};

// 常用语详情
export const commonTermsDetail = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/getCommonLanguageOne",
    data
  );
};

// 常用语新增
export const addCommonTerms = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/addCommonLanguage",
    data
  );
};

// 常用语编辑
export const updataCommonTerms = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/editCommonLanguage",
    data
  );
};

// 常用语删除
export const deleteCommonTerms = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/deleteCommonLanguage",
    data
  );
};
// 小览chatGpt上报消息记录
export const addChatData = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/addChatData",
    data
  );
};
// 小览chatGpt获取消息记录（可翻页
export const queryChatData = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/activityOpen/queryChatData",
    data
  );
};

// 获取在线顾问列表
export const serviceRole = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/companyOpen/serviceRole",
    data
  );
};

// 发送消息文本
export const sendSingleTextMessage = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/sendSingleTextMessage",
    data
  );
};

// 错误日志报警
export const reportImLog = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/imOpen/reportIMLog",
    data
  );
};

// 获取会话记录（一览）
export const getConversationList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/tencentIm/getConversationList",
    data
  );
};

// 获取消息历史记录（一览）
export const getChatMsgList = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/tencentIm/getChatMsgList",
    data
  );
};

// 检测会话信息
export const chatConversationCheck = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/tencentIm/chatConversationCheck",
    data
  );
};

// 消息已读（接口）
export const chatReadLog = (data) => {
  return request.webservice(
    "mp",
    `${apiClusterJava}/api-yp/open/index`,
    "/tencentIm/chatReadLog",
    data
  );
};
